package com.serviceImpl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.dao.TrainDao;
import com.model.Train;
import com.service.TrainService;

@Component("trainService")
public class TrainServiceImpl implements TrainService {

	private TrainDao trainDao;
	public void addTrain(Train train) {
		System.out.println("111");
		trainDao.addTrain(train);
	}

	public void deleteTrain(Train train) {
		trainDao.deleteTrain(train);
	}

	public Train getTrainById(int id) {
		return trainDao.getTrain(id);
	}

	public List<Train> getTrainList(String hql) {
		return trainDao.getTrainList(hql);
	}

	public void updateTrain(Train train) {
		trainDao.updateTrain(train);

	}

	public TrainDao getTrainDao() {
		return trainDao;
	}
	@Resource
	public void setTrainDao(TrainDao trainDao) {
		this.trainDao = trainDao;
	}

}
